import {Component, Input} from '@angular/core';

@Component({
  selector: 'app-chart-detail',
  templateUrl: './chart-detail.component.html',
  styleUrl: './chart-detail.component.scss'
})
export class ChartDetailComponent {
  @Input()
  headTitle: string = '用电详情';
  @Input()
  chartData: IChartData = {
    num: 147,
    unit: 'kWh',
    desc: '今日用电'
  };
  @Input()
  powerData: IPowerData[] = [
    {name: '光伏', value: 147, color: '#4371CC', unit: 'kWh'}
    , {name: '储能', value: 24, color: '#3DCC6C', unit: 'kWh'}
    , {name: 'v2g', value: 12, color: '#00FFFF', unit: 'kWh'}
    , {name: '市电', value: 61, color: '#a9278b', unit: 'kWh'}
  ];
}

interface IPowerData {
  name: string;
  value: number;
  color: '#4371CC' | '#3DCC6C' | '#00FFFF' | '#a9278b'
  unit: 'kWh';
}

interface IChartData {
  num: number;
  unit: 'kWh';
  desc: '今日用电';
}
